#ifndef _FMETRICS_H_
#define _FMETRICS_H_

namespace Font
{

	class KerningTable;

	class Metrics
	{
	
	public:
	
		Metrics(Library* a_Library, Loader* a_Loader, Family* a_Family);
		~Metrics();

		virtual FaceHandle* CreateFace(unsigned int a_Size, unsigned int a_Options = 0, CharMap* a_Map = NULL) = 0;

		FaceHandle* CreateFont(unsigned int a_Size, unsigned int a_LineHeight);

		void SetFace(Face* a_Face);
		Face* GetFace();

		Library* GetLibrary();
		Family* GetFamily();

		bool CheckMatchStyle(unsigned int a_Style);

		unsigned int GetRangeStart();
		unsigned int GetRangeEnd();
	
	protected:

		Loader* m_Loader;
		Family* m_Family;
		Face* m_Owner;
		unsigned int m_Style;
		unsigned int m_RangeStart, m_RangeEnd;

		CharMap* m_CharMap;

		std::vector<FaceHandle*> m_Handles;
		std::map<unsigned int, FaceHandle*> m_HandlesBySize;

		bool m_OptionKerning;
		bool m_OptionMarkNonExisting;

		Library* m_Library;
	
	}; // class Metrics

}; // namespace Font
	
#endif